<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>免费提问详情页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
	<c:set var="ctx" value="${pageContext.request.contextPath}" />
    <link rel="stylesheet" href="${ctx}/assets/css/amazeui.min.css">
    <link rel="stylesheet" href="${ctx}/assets/css/style.css?v=2.3">
    <link rel="stylesheet" href="${ctx}/assets/css/index.css?v=2.3">
</head>
<body class="bg-gray">
<header data-am-widget="header" class="am-header am-header-default am-header-fixed am-border-bottom">
    <div class="am-header-left am-header-nav">
        <a onclick="history.go(-1)">  <i class="icon_8"></i>
        </a>
    </div>
    <h1 class="am-header-title">
        详情
    </h1>

</header>
<section class="am-padding-bottom-sm" id="amz-main" data-tag="css-nav">


    <div class="bg-white">
        <!--咨询师-->
        <div class="am-g  am-padding-top-sm bg">
            <div class=" am-u-sm-12 am-list-main  am-padding-left-sm">
                <div class="div-65">
                    <a class="">
                        <img class="img-65" src="${wxUser.headimgurl}"/>
                    </a>
                </div>
                <div class="am-list-item-hd font-color-13 am-text-center">
                  ${wxUser.nickname}
                </div>
            </div>
        </div>
        <!--咨询介绍-->
        <div class=" am-padding-bottom-sm">
            <div class="report_item bg-gray am-margin-left-sm am-margin-right-sm am-margin-top-sm ">
                <div class="am-g   am-padding-top-sm   am-padding-bottom-sm">
                    <div class=" am-u-sm-12 am-list-main font-color-13 box">
                        <i class="icon_12"></i>

                        <div class="width-50px">
                            <div class="icon_9-1"></div>
                            <div class="line-1">
                                <i class="circle-1"></i>
                            </div>

                        </div>
                        <div class="box-1">
                            <div class="am-list-item-hd font-color-13 am-padding-top-sm am-text-truncate">
                                咨询类别：${freeAsk.direction}
                            </div>
                            <div class="font-14  margin-top-9 ">
                                预约时间：${freeAsk.askTimeStr}
                            </div>

                        </div>
                    </div>


                </div>
            </div>
        </div>

    </div>
    <div class="bg-white am-margin-top-sm  am-padding-bottom-xs">
        <!-- 问题描述-->
        <div class="icon_26 am-text-center font-color-12 ">
            问题描述
        </div>

        <div class="am-padding-bottom-sm">
            <div class="am-container font-color-13 font-14 am-margin-top-sm">
            	<c:if test="${freeAsk.type==0}">
            			${freeAsk.question}
            	</c:if>
            	<c:if test="${freeAsk.type==1}">
            		<div class='btn_18 voice' >
		 			<input type='hidden' value="${freeAsk.question}">
		            <i class='icon_711 '></i><span></span>
		            </div>
            	</c:if>
            </div>
        </div>

</div>
        <div class="bg-white   am-padding-bottom-xs">
             <!-- 咨询师回复-->
        <div class="icon_26 am-text-center font-color-12 margin-top-15 ">
            咨询师回复
        </div>
        <div class="">

            <div class=" bg-gray am-margin-left-sm am-margin-right-sm am-margin-top-sm">
                <div class="am-g   am-padding-top-sm am-padding-bottom-xs border-1">

                    <div class=" am-u-sm-12 am-list-main">
                        <i class="icon_12"></i>

                        <div class="font-14  font-color-13 ">
                            <c:if test="${isYuyin==0}">
            			${freeAsk.counseAnswer}
            	</c:if>
            	<c:if test="${isYuyin==1}">
            		<div class='btn_18 voice' >
		 			<input type='hidden' value="${freeAsk.counseAnswer}">
		            <i class='icon_711 '></i><span></span>
		            </div>
            	</c:if>
                        </div>
                    </div>

                </div>
            </div>
            </div>
            </div>
                 <!--用户评价-->
        <div class="icon_24 am-text-center font-color-15">
            用户评价
        </div>
        <c:if test="${freeAsk.status==1}">
        <div class="icon_55"></div>
            <div class="am-text-center font-14 font-color-15">暂无评论，快点击评论按钮，抢沙发吧！</div>
        </c:if> 
        <c:if test="${freeAsk.status==2}">
        <div class="mark_list">

            <div class="am-list-news am-list-news-default ">

                <div class="am-list-news-bd am-margin-left-sm am-margin-right-sm">
                    <ul class="am-list">
                        <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">

                            <div class=" am-u-sm-12 am-list-main font-14 box">

                                <div class="width-60px">
                                    <a class="">
                                        <img class="img-50" src="${wxUser.headimgurl}"/>
                                    </a>
                                </div>
                                <div class="box-1 margin-top-5">
                                    <h3 class="am-list-item-hd font-color-main">
                                        <div class="am-g am-g-collapse">
                                            <div class="am-u-sm-8"><span
                                                    class="font-color-13 font-15 font-bold">${wxUser.nickname}</span>
                                            </div>
                                            <div class="am-u-sm-4 font-color-16  padding-top-2pxs am-text-right">
                                                ${freeAsk.pingjiaTimeStr}
                                            </div>
                                        </div>
                                    </h3>
                                    <div class="font-14 font-color-13 ">
                                        <span class="am-fl font-color-15">评分：</span>
                                        <c:if test="${freeAsk.pingjiaxx==1}">
                                         	<i class="star-cur"></i>
                                        </c:if>
                                        <c:if test="${freeAsk.pingjiaxx==2}">
                                         	<i class="star-cur"></i>
                                         	 <i class="star-cur"></i>
                                        </c:if>
                                        <c:if test="${freeAsk.pingjiaxx==3}">
                                         	<i class="star-cur"></i>
                                         	 <i class="star-cur"></i>
                                         	 <i class="star-cur"></i>
                                        </c:if>
                                        <c:if test="${freeAsk.pingjiaxx==4}">
                                         	<i class="star-cur"></i>
                                         	 <i class="star-cur"></i>
                                         	 <i class="star-cur"></i>
	                                        <i class="star-cur"></i>
                                        </c:if>
                                        <c:if test="${freeAsk.pingjiaxx==5}">
                                         	<i class="star-cur"></i>
	                                        <i class="star-cur"></i>
	                                        <i class="star-cur"></i>
	                                        <i class="star-cur"></i>
	                                        <i class="star-cur"></i>
                                        </c:if>
                                        
                                    </div>

                                </div>

                            </div>
                            <div class=" am-u-sm-12 am-list-main font-14 font-color-15 am-margin-top-xs">
                                ${freeAsk.pingjia}
                            </div>
                        </li>

                    </ul>
                </div>

            </div>
        </div>
        	</c:if>
<!--隐藏音频-->
    <div class="am-hide">
        <audio src=""  id="audio">亲 您的浏览器不支持html5的audio标签</audio>
    </div>
</section>
<div class="am-modal am-modal-prompt" tabindex="-1" id="my-prompt">
    <div class="am-modal-dialog">
        <div class="am-modal-hd">评论</div>
        <div class="am-modal-bd">
            <textarea rows="3" class="mark_content am-modal-prompt-input">
            </textarea>
        </div>
        <div class="am-modal-footer">
            <span class="am-modal-btn" data-am-modal-cancel>取消</span>
            <span class="am-modal-btn" data-am-modal-confirm>提交</span>
        </div>
    </div>
</div>

<script src="${ctx}/assets/js/jquery.min.js"></script>
<script src="${ctx}/assets/js/amazeui.min.js"></script>
<script>
    $("#btntext").on("click",function(){
 		type="0";
        var $voices=$("#btnvoice").find(".icon_46");
        $("#font_voice").text("语音");
       
        $voices.removeClass("cur");

        $("#txt_question_content").removeClass("am-hide").focus();

    });

    $("#btnvoice").on("click",function(){
		type="1";
        $("#txt_question_content").addClass("am-hide");
        var $voices=$(this).find(".icon_46");
        if($voices.hasClass("cur")){
            $voices.removeClass("cur");
            $("#font_voice").text("点击开始");
        } else{
            $voices.addClass("cur");
            $("#font_voice").text("点击结束");
        }

    });

    $(".voice").on("click",function(){
            var audio = document.getElementById("audio");
            audio.src=$(this).find("input").val(); 
            
             var eventTester = function(e){
                audio.addEventListener(e,function(){
                    $voices.removeClass("cur");
                },false);
            };
            eventTester("ended");
            
          var $voices= $(this).find(".icon_711");
            $(".report_item .voice").find(".icon_711").remove("cur");
            if($voices.hasClass("cur")){
                $voices.removeClass("cur");
                audio.pause();
            }else{
                $voices.addClass("cur");
                audio.play();
            }

        });
</script>
</body>
</html>